import Vue from "vue";
import VueRouter from "vue-router"
Vue.use(VueRouter)

export default new VueRouter({
    mode: "hash",
    routes: [{
            path: "/login",
            name: "login",
            component: () => import("../views/NewLogin.vue")
        },
        {
            path: "/layout",
            name: "layout",
            component: () => import("../views/Layout.vue"),
            children: [{
                    path: "admin",
                    name: "admin",
                    component: () => import("../views/admin.vue"),
                    meta: {
                        name: "首页",
                        name1: "用户管理",
                        name2: "管理员",

                    }
                },
                {
                    path: "stu",
                    name: "stu",
                    component: () => import("../views/stu.vue"),
                    meta: {
                        name: "首页",
                        name1: "用户管理",
                        name2: "学员管理"
                    }
                },
                {
                    path: "add",
                    name: "add",
                    component: () => import("../views/add.vue"),
                    meta: {
                        name: "首页",
                        name1: "课程管理",
                        name2: "课程添加"
                    }
                },
                {
                    path: "list",
                    name: "list",
                    component: () => import("../views/list.vue"),
                    meta: {
                        name: "首页",
                        name1: "课程管理",
                        name2: "课程列表"
                    }
                },
                {
                    path: "mudel",
                    name: "mudel",
                    component: () => import("../views/mudel.vue"),
                    meta: {
                        name: "首页",
                        name1: "课程管理",
                        name2: "课程模块"
                    }
                },
            ],
            meta: {
                name: "首页"
            }
        }, {
            path: "/",
            redirect: "/login",
            meta: {
                name: "登录"
            }
        },

    ]
})